package com.chenyi.leetcode.editor.cn;

import java.util.Arrays;

/**
 * [面试题 10.01]合并排序的数组
 * @author by chenyi
 * @className SortedMergeLcci
 * @date 2022-08-27 16:33:35
 */
public class SortedMergeLcci{
    public static void main(String[] args) {
        Solution solution = new SortedMergeLcci().new Solution();
        solution.merge(new int[]{1, 2, 3, 0, 0, 0}, 3, new int[]{2, 5, 6}, 3);
    }
    @SuppressWarnings("AlibabaCommentsMustBeJavadocFormat")
    //leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public void merge(int[] A, int m, int[] B, int n) {
        for (int i = 0; i < n; i++) {
            A[m + i] = B[i];
        }
        Arrays.sort(A);
        System.out.println(Arrays.toString(A));
    }
}
//leetcode submit region end(Prohibit modification and deletion)

}
